//
//  DFpictureCell.m
//  DFront
//
//  Created by lanou on 15/10/30.
//  Copyright © 2015年 xuzenghui. All rights reserved.
//

#import "DFpictureCell.h"
#import "UIImageView+WebCache.h"
#import "DFSignlTon.h"

@implementation DFpictureCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
     
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 5, kScreenWidth - 10, 45)];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLabel];
        
        _imgSrcImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 55, kScreenWidth - 10, 170)];
        [self.contentView addSubview:_imgSrcImage];
        
        _dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 240, 150, 15)];
        _dateLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_dateLabel];
        
        _numLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 80, 240, 60, 15)];
        _numLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_numLabel];
        
        
        _comNumLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 30, 240, 25, 15)];
        _comNumLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_comNumLabel];
        
//        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 260, kScreenWidth, 2)];
//        line.backgroundColor = [UIColor lightGrayColor];
//        [self.contentView addSubview:line];
        
        UIImageView *aimage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 45, 240, 15, 15)];
        aimage.image = [UIImage imageNamed:@"a"];
        [self.contentView addSubview:aimage];
        
        UIImageView *bimage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 96, 240, 15, 15)];
        bimage.image = [UIImage imageNamed:@"hot"];
        [self.contentView addSubview:bimage];
    }
    return self;
}



-(void)setConfigureModel:(DFPictureModel *)ConfigureModel{
    
    _ConfigureModel = ConfigureModel;
    
    DFSignlTon *signlTon = [DFSignlTon shareInstance];
    if (signlTon.savemode == SaveModeYes)
    {
        _imgSrcImage.image = [UIImage imageNamed:@""];
    }else
    {
       [_imgSrcImage sd_setImageWithURL:[NSURL URLWithString:ConfigureModel.imgSrc]];
    }

    
  
    _titleLabel.text = ConfigureModel.title;
    NSString *str = ConfigureModel.date;
    _dateLabel.text = [str substringToIndex:10];
    _numLabel.text = [NSString stringWithFormat:@"%@",ConfigureModel.num];
    _comNumLabel.text = [NSString stringWithFormat:@"%@",ConfigureModel.comNum];
    
    
    
    
    
}




@end
